<template>
  <div>
      <span>这是自定义的组件 - {{ title }}</span>
      <!-- 时间 -->
      <slot name="time"> </slot>
      <br>
      <button @click="change" >修改title</button>
      <!-- 作者 -->
      <slot name="author"></slot>
  </div>
</template>

<script>
export default {
  props: [
    'title'
  ],
  methods: {
    change: function () {
      // this.title = "每日新闻"
      console.log(123)
      this.$emit("changeTitle", "每日新闻")
    }
  }
}
</script>

<style>

</style>